(* Mathematica package *)


SetAttributes[PhaseMv, Listable]
(*Layer Phase*)
phiv = 2 Pi #1 #3 #4 Cos[#2]&;(*[omega, theta, n, d]*)

PhaseMv[omega_, theta_, n_, d_] := 
	Block[{phi = Exp[I phiv[omega, theta, n, d]]}, 
		{{phi^(-1), 0},{0, phi}}];

PhaseMv[omega_, theta_, n_, List] := 
	IdentityMatrix[2]; 

PhaseMv[omega_, theta_, n_, d_Part] := 
	IdentityMatrix[2];

PhaseMv[___]/;Message[General::badargs,PhaseMv] := 
	"unevaluated";